/**
 *
 * 角色掉线
 *
 */

const rootPath = '../../../';
const baseWS = require(rootPath + 'common/base-ws');
const router = require('express').Router();
const expressWs = require('express-ws');
expressWs(router);

router
.ws('/offline', (ws, req)=>{
    console.log('ws offline api')
    // baseWS.del_online(req.cookies.uid)
    console.log(global.ONLINE_LISTS)
    ws.send(JSON.stringify({
        result: {
            msg:'您已掉线'
        }
    }));
    ws.close();
});

module.exports = router;
